CleanBlog 博客主题配置

CleanBlog 简约主题你值得拥有

Posted by pangrongxian on 2015-12-25

https://github.com/klugjo/hexo-theme-clean-blog

Installation 安装

$ git clone https://github.com/klugjo/hexo-theme-clean-blog.git

使用 git clone 命令把 clean-blog 主题文件下载到本地

themes/clean-blog

Then update your blog’s main _config.yml to set the theme to clean-blog:

更新你的博客主参数文件 _config.yml ,把主题设置为 clean-blog:

1
2
3
4
5
6
# Extensions
## Plugins: http://hexo.io/plugins/
## Themes: http://hexo.io/themes/
theme: clean-blog
Configuration

意思是:在主参数配置文件中找到这段代码,把主题 theme 设置成:clean-blog

Menu 菜单

The menu is configured in the theme’s _config.yml.

菜单在主题文件的配置文件_config.yml中去设置

1
2
3
4
5
6
7
# Header
menu:
Home: /
Archives: /archives
Github:
url: https://github.com/klugjo/hexo-theme-clean-blog
icon: github

The object key is the label and the value is the path, or you can use a icon (font awesome) like menu item.

Top Left Label

The top left label is configured in the theme’s _config.yml. When clicked it will lead to the Home Page.

1
2
# Title on top left of menu. Leave empty to use main blog title
menu_title: Configurable Title

Home Page cover image - 主页封面图片

The Home Page cover is configured in the theme’s _config.yml. It will be the same for all index type pages.

主页封面图在主题配置文件_config.yml中设置,其他所有类型的引导页面都是一样的方法去设置

1
2
# URL of the Home page image
index_cover: /img/home-bg.jpg

Default post title

The default post title (used when no title is specified) is configured in the theme’s _config.yml.

1
2
# Default post title
default_post_title: Untitled

Comments 评论

The comments provider is specified in the theme’s _config.yml. If you specify both a disqus_shortname and a facebook.appid there will be 2 sets of comment per post. So choose one.

1
2
3
4
5
6
7
8
9
# Comments. Choose one by filling up the information
comments:
# Disqus comments
disqus_shortname: klugjotest
# Facebook comments
facebook:
appid: 123456789012345
comment_count: 5
comment_colorscheme: light

如何获得评论功能呢?

注册成为 facebook平台开发者,并创建一个项目,获得应用编号,应用编号即:appid

注册地址: https://developers.facebook.com/

You can too hide the comment in the posts front-matter: //隐藏评论设置 false

1
2
comment: false
---

Google Analytics //谷歌分析

The Google Analytics Tracking ID is configured in the theme’s _config.yml.

1
2
# Google Analytics Tracking ID // 谷歌分析跟踪ID
google_analytics:

如何让获得谷歌分析服务?

创建谷歌分析帐号,获得谷歌分析跟踪ID即可。

注册地址 : https://www.google.com/intl/zh-CN/analytics/

Addthis

The Addthis ID is configured in the theme’s _config.yml.

1
2
# Addthis ID
addthis:

分享功能如何获得?

使用 Addthis 的服务,注册并获取 Your Profile ID 即可。

https://www.addthis.com/

Social Account 社交账户

Setup the links to your social pages in the theme’s _config.yml. Links are in the footer.

1
2
3
4
5
6
# Social Accounts
twitter_url:
facebook_url:
github_url: https://github.com/klugjo/hexo-theme-clean-blog
linkedin_url:
mailto:

Author 作者

The post’s author is specified in the posts front-matter:

1
2
author: Klug Jo
---

Post’s Cover Image 文章封面图片

By default, posts will use the home page cover image. You can specify a custom cover in the front-matter:

1
2
3
4
5
title: Excerpts
date: 2013-12-25 00:23:23
tags: ["Excertps"]
cover: /assets/contact-bg.jpg
---

Post’s Share Cover Image 文章分享封面图

You can specify a custom cover to share yours posts in social medias:

1
2
share_cover: /assets/contact-bg.jpg
---

Post’s Excerpt 摘录

This theme does not support traditional excerpts. To show excerpts on the index page, use subtitle in the front-matter:

1
2
3
4
5
title: Excerpts
date: 2013-12-25 00:23:23
tags: ["Excertps"]
subtitle: Standard Excerpts are not supported in Clean Blog but you can use subtitles in the front matter to display text in the index.
---

Tags page. 标签页

Follow these steps to add a tags page that contains all the tags in your site.

  • Create a page named tags //创建一个标签页
1
$ hexo new page "tags"
  • Edit the newly created page and set page type to tags in the front matter.
1
2
title: All tags
type: "tags"
  • Add tags to the menu in the theme _config.yml: // 在主题配置文件中添加标签菜单
1
2
3
4
5
# Header
menu:
Home: /
Archives: /archives
Tags: /tags

Categories page. 分类页

Follow these steps to add a categories page that contains all the categories in your site.

  • Create a page named categories // 创建一个分类页
1
$ hexo new page "categories"
  • Edit the newly created page and set page type to categories in the front matter.
1
2
title: All tags
type: "categories"

// 在主题配置文件中添加分类签菜单

  • Add Categories to the menu in the theme _config.yml:
1
2
3
4
5
# Header
menu:
Home: /
Archives: /archives
Categories: /categories

Comments: